<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:af="http://myfaces.apache.org/trinidad"
    xmlns:afh="http://myfaces.apache.org/trinidad/html">
    <af:panelFormLayout styleClass="searchWizard">
		<af:outputFormatted value="#{localeBundle.searchHeader}" 
            styleUsage="inContextBranding"/>
        <af:spacer height="10px"/>
        <af:panelList maxColumns="1"
            rendered="#{empty pageFlowScope.detailsViewSearchWizard}">
            <c:forEach var="item" items="#{processPortalSearchWizards}">
                <af:group>
                    <af:commandLink text="#{item.linkLabel}"
                        rendered="#{not empty item.detailsUrl}">
                        <af:setActionListener from="#{item}"
                            to="#{pageFlowScope.detailsViewSearchWizard}"/>
                    </af:commandLink>
                    <af:commandLink text="#{item.linkLabel}"
                        actionListener="#{portalHeader.injectSearchWizard}"
                        rendered="#{empty item.detailsUrl}">
                        <f:attribute name="searchWizardToInject" value="#{item}"/>
                    </af:commandLink>
                </af:group>
             </c:forEach>
        </af:panelList>
        <c:if test="#{not empty pageFlowScope.detailsViewSearchWizard}">
            <af:spacer height="5px"/>
               <ui:include src="#{pageFlowScope.detailsViewSearchWizard.detailsUrl}">
                  <ui:param name="searchWizardItem" value="#{pageFlowScope.detailsViewSearchWizard}"/>
               </ui:include>
            <af:spacer height="5px"/>
        </c:if>
		<f:facet name="footer">
			<af:panelButtonBar halign="center" styleClass="searchWizardButtonBar">
				<af:commandButton text="#{commonMsg.cancel}" action="success" 
                    rendered="#{empty pageFlowScope.detailsViewSearchWizard}">
                    <af:setActionListener from="#{false}" 
                        to="#{pageFlowScope.showSearchWizard}"/>
				</af:commandButton>
                <af:commandButton text="#{commonMsg.goBack}" action="success" 
                    rendered="#{not empty pageFlowScope.detailsViewSearchWizard}">
                    <af:setActionListener from="#{null}" 
                        to="#{pageFlowScope.detailsViewSearchWizard}"/>
                </af:commandButton>
                <af:commandButton text="#{commonMsg.search}" action="success" 
                    rendered="#{not empty pageFlowScope.detailsViewSearchWizard}"
                    actionListener="#{portalHeader.injectSearchWizard}">
                    <f:attribute name="searchWizardToInject" 
                        value="#{pageFlowScope.detailsViewSearchWizard}"/>
                </af:commandButton>
			</af:panelButtonBar>
		</f:facet>
	</af:panelFormLayout>
</ui:composition>